package br.com.gc.rfqx.model.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceException;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import br.com.gc.rfqx.model.entity.Customer;

@Repository
public class CustomerDaoJpa implements CustomerDao {

	@PersistenceContext
	private EntityManager em;
	
	public CustomerDaoJpa() {
	}
	
	
	/* (non-Javadoc)
	 * @see br.com.gc.rfqx.model.dao.CustomerDao#create(br.com.gc.rfqx.model.entity.Customer)
	 */
	
	@Override
	public void create (Customer customer){
		try {
			em.persist(customer);
		} catch (PersistenceException e) {
			e.printStackTrace();
		}
		
		
	}
	
	/* (non-Javadoc)
	 * @see br.com.gc.rfqx.model.dao.CustomerDao#update(br.com.gc.rfqx.model.entity.Customer)
	 */
	@Override
	public void update (Customer customer){
		
	}
	
	/* (non-Javadoc)
	 * @see br.com.gc.rfqx.model.dao.CustomerDao#delete(br.com.gc.rfqx.model.entity.Customer)
	 */
	@Override
	public void delete (Customer customer){
		
	}
	
	
	/* (non-Javadoc)
	 * @see br.com.gc.rfqx.model.dao.CustomerDao#findById(java.lang.Long)
	 */
	@Override
	public Customer findById (Long id){
		return null;
	}	
	
	
	/* (non-Javadoc)
	 * @see br.com.gc.rfqx.model.dao.CustomerDao#listAll()
	 */
	@Override
	public List<Customer> listAll () {
		
		
		return null;
	}	
	
	
}
